package kr.hkit.powerjava.chapter08;

import java.util.Scanner;

class DiceGame{
	int diceFace;
	int userGuess;
	
	private void RollDice() {
		diceFace=(int)(Math.random()*6)+1;
		
	}
	private int getUserInput(String prompt) {
		
		System.out.println(prompt);
		Scanner s = new Scanner(System.in);
		return s.nextInt();
		
	}
	
	private void checkUserGuess() {
		if (diceFace==userGuess)
			System.out.println("O");
		else
			System.out.println("X");
		
	}
	public void startPlaying() {
		userGuess = getUserInput("예상값입력 : ");
		RollDice();
		checkUserGuess();
		
	}
}

public class DiceGameTest {
	public static void main(String[] args) {
		DiceGame game = new DiceGame();
		game.startPlaying();
	}

}
